package cn.gameback.supervisionservices.service.impl;

import cn.gameback.supervisionservices.entity.Course;
import cn.gameback.supervisionservices.mapper.CourseMapper;
import cn.gameback.supervisionservices.service.CourseService;
import cn.gameback.supervisionservices.vo.RequestVo.CourseVo.CourseQuery;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CourseServiceImpl implements CourseService {
    @Autowired
    private CourseMapper courseMapper;

    @Override
    public IPage<Course> getAllCourse(CourseQuery courseQueryRequest){
        Page<Course> coursePage = new Page<>(courseQueryRequest.getCurrent(),courseQueryRequest.getPageSize());
        QueryWrapper<Course> queryWrapper = new QueryWrapper<>();



        return courseMapper.selectPage(coursePage, queryWrapper);
    }
}
